﻿function Disconnect-TSMServer {
    <#
        .SYNOPSIS
            Disconnect from TSM server
                    
        .DESCRIPTION
            The Disconnect-TSMServer disconnects the PSSession from the Windows server
        
        .EXAMPLE
            Disonnect-TSMServer

        .NOTES
            Contributors:  David Seibel
            Last Revision Date: 09/15/2015

    #>
    [CmdletBinding()]
    Param()
	
    Disconnect-PSSession  $TSMSession
    Remove-PSSession $TSMSession
	
	Remove-Variable TSMCredential -Scope Global
	Remove-Variable TSMServer -Scope Global
	Remove-Variable TSMSession -Scope Global
}